<!-- HTML header for doxygen 1.9.1-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.9.4" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>NumCpp: NumCpp</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
    <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
    <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
    <!-- ... other metadata & script includes ... -->
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeDarkModeToggle.init()
    </script>
    <script type="text/javascript"
        src="../doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeFragmentCopyButton.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-paragraph-link.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeParagraphLink.init()
    </script>
    <script type="text/javascript" src="../doxygen-awesome-css/doxygen-awesome-interactive-toc.js"></script>
    <script type="text/javascript">
        DoxygenAwesomeInteractiveToc.init()
    </script>
</head>
<body>
    <div id="top">
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr style="height: 56px;">
                        <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png" /></td>
                        <td id="projectalign" style="padding-left: 0.5em;">
                            <div id="projectname">NumCpp
                                &#160;<span id="projectnumber">2.12.1</span>
                            </div>
                            <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part --><!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">NumCpp </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md__home_dpilger_Github_NumCpp_README"></a> <img src="https://github.com/dpilger26/NumCpp/raw/master/docs/logo/NumCppLogo.png" alt="NumCpp logo" class="inline"/></p>
<p ><a href="https://GitHub.com/dpilger26/NumCpp/watchers/"><img src="https://img.shields.io/github/watchers/dpilger26/NumCpp.svg?style=social&amp;label=Watch&amp;maxAge=2592000" alt="GitHub watchers" style="pointer-events: none;" class="inline"/></a> <a href="https://GitHub.com/dpilger26/NumCpp/stargazers/"><img src="https://img.shields.io/github/stars/dpilger26/NumCpp.svg?style=social&amp;label=Star&amp;maxAge=2592000" alt="GitHub stars" style="pointer-events: none;" class="inline"/></a> <a href="https://GitHub.com/dpilger26/NumCpp/network/"><img src="https://img.shields.io/github/forks/dpilger26/NumCpp.svg?style=social&amp;label=Fork&amp;maxAge=2592000" alt="GitHub forks" style="pointer-events: none;" class="inline"/></a></p>
<p ><img src="https://github.com/dpilger26/NumCpp/actions/workflows/Tests.yml/badge.svg" alt="Build status" style="pointer-events: none;" class="inline"/> <a href="https://app.codacy.com/manual/dpilger26/NumCpp?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dpilger26/NumCpp&amp;utm_campaign=Badge_Grade_Dashboard"><img src="https://api.codacy.com/project/badge/Grade/ea24c08d892e4beebd46cfca260823c1" alt="Codacy Badge" class="inline"/></a> <a href="https://awesome.re"><img src="https://awesome.re/badge.svg" alt="Awesome" style="pointer-events: none;" class="inline"/></a> <a href="https://www.paypal.com/donate/?hosted_button_id=JDFK4DUMJJWYY"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate" style="pointer-events: none;" class="inline"/></a></p>
<h1>NumCpp: A Templatized Header Only C++ Implementation of the <a href="http://www.numpy.org">Python NumPy Library</a></h1>
<h2>Author: David Pilger <a href="#" onclick="location.href='mai'+'lto:'+'dpi'+'lg'+'er2'+'6@'+'gma'+'il'+'.co'+'m'; return false;">dpilg<span class="obfuscator">.nosp@m.</span>er26<span class="obfuscator">.nosp@m.</span>@gmai<span class="obfuscator">.nosp@m.</span>l.co<span class="obfuscator">.nosp@m.</span>m</a></h2>
<h2>Version: <img src="https://img.shields.io/github/tag-date/dpilger26/NumCpp.svg?color=blue&amp;label=Official%20Release&amp;style=popout" alt="GitHub tag (latest by date)" style="pointer-events: none;" class="inline"/></h2>
<h2>License <a href="https://lbesson.mit-license.org/"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT license" style="pointer-events: none;" class="inline"/></a></h2>
<h2>Testing</h2>
<p ><b>C++ Standards:</b> <br  />
 <a href="https://isocpp.org/std/the-standard"><img src="https://img.shields.io/badge/C%2B%2B-17-blue.svg" alt="C++17" style="pointer-events: none;" class="inline"/></a> <a href="https://isocpp.org/std/the-standard"><img src="https://img.shields.io/badge/C%2B%2B-20-blue.svg" alt="C++20" style="pointer-events: none;" class="inline"/></a></p>
<p ><b>Compilers:</b> <br  />
 Visual Studio: 2022 <br  />
 GNU: 11.3 Clang: 14 <br  />
</p>
<p ><b>Boost Versions:</b> <br  />
 1.73+</p>
<h2><a href="https://dpilger26.github.io/NumCpp">Documentation</a></h2>
<h2><a href="https://github.com/dpilger26/NumCpp">GitHub</a></h2>
<p ><a href="https://star-history.com/#dpilger26/NumCpp&amp;Date"><img src="https://api.star-history.com/svg?repos=dpilger26/NumCpp&amp;type=Date" alt="Star History Chart" class="inline"/></a></p>
<h2><a href="https://github.com/dpilger26/NumCpp/tree/master/docs/markdown/Installation.md">Installation</a></h2>
<h2><a href="https://github.com/dpilger26/NumCpp/tree/master/docs/markdown/Building.md">Building</a></h2>
<h2><a href="https://github.com/dpilger26/NumCpp/tree/master/docs/markdown/ReleaseNotes.md">Release Notes</a></h2>
<h2>From NumPy To NumCpp – A Quick Start Guide</h2>
<p >This quick start guide is meant as a very brief overview of some of the things that can be done with <b>NumCpp</b>. For a full breakdown of everything available in the <b>NumCpp</b> library please visit the <a href="https://dpilger26.github.io/NumCpp">Full Documentation</a>.</p>
<h3>CONTAINERS</h3>
<p >The main data structure in <b>NumCpp</b> is the <code>NdArray</code>. It is inherently a 2D array class, with 1D arrays being implemented as 1xN arrays. There is also a <code>DataCube</code> class that is provided as a convenience container for storing an array of 2D <code>NdArray</code>s, but it has limited usefulness past a simple container.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a = np.array([[1, 2], [3, 4], [5, 6]])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;int&gt; a = { {1, 2}, {3, 4}, {5, 6} }</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a.reshape([2, 3])</code>   </td><td class="markdownTableBodyCenter"><code>a.reshape(2, 3)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.astype(np.double)</code>   </td><td class="markdownTableBodyCenter"><code>a.astype&lt;double&gt;()</code>   </td></tr>
</table>
<h3>INITIALIZERS</h3>
<p >Many initializer functions are provided that return <code>NdArray</code>s for common needs.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linspace(1, 10, 5)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a6d8333f2bb5e655f0317644d61fab51b">nc::linspace</a>&lt;dtype&gt;(1, 10, 5)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.arange(3, 7)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a8e78c416b2386411d8c6b5226bd4c78a">nc::arange</a>&lt;dtype&gt;(3, 7)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.eye(4)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ab97edf38a4c2d559a5e8824c69b3562a">nc::eye</a>&lt;dtype&gt;(4)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.zeros([3, 4])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#abce4b61ffbaa3276f4f84088fdf25e95">nc::zeros</a>&lt;dtype&gt;(3, 4)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 0</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.ones([3, 4])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a1ec10d595929f57dc04559db28b6b276">nc::ones</a>&lt;dtype&gt;(3, 4)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a = 1</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.nans([3, 4])</code>   </td><td class="markdownTableBodyCenter"><code>nc::nans(3, 4)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;double&gt;(3, 4) a = <a class="el" href="namespacenc_1_1constants.html#af94758715a9a5157d7ca95ab89d390ac" title="NaN.">nc::constants::nan</a></code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.empty([3, 4])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a3012780ddd20c705d9cff13bac986eff">nc::empty</a>&lt;dtype&gt;(3, 4)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="classnc_1_1_nd_array.html" title="Holds 1D and 2D arrays, the main work horse of the NumCpp library.">nc::NdArray</a>&lt;dtype&gt;(3, 4) a</code>   </td></tr>
</table>
<h3>SLICING/BROADCASTING</h3>
<p ><b>NumCpp</b> offers <b>NumPy</b> style slicing and broadcasting.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[2, 3]</code>   </td><td class="markdownTableBodyCenter"><code>a(2, 3)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[2:5, 5:8]</code>   </td><td class="markdownTableBodyCenter"><code>a(<a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays.">nc::Slice(2, 5)</a>, <a class="el" href="classnc_1_1_slice.html" title="A Class for slicing into NdArrays.">nc::Slice(5, 8)</a>)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a({2, 5}, {5, 8})</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[:, 7]</code>   </td><td class="markdownTableBodyCenter"><code>a(a.rSlice(), 7)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5]</code>   </td><td class="markdownTableBodyCenter"><code>a[a &gt; 5]</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>a[a &gt; 5] = 0</code>   </td><td class="markdownTableBodyCenter"><code>a.putMask(a &gt; 5, 0)</code>   </td></tr>
</table>
<h3>RANDOM</h3>
<p >The random module provides simple ways to create random arrays.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.random.seed(666)</code>   </td><td class="markdownTableBodyCenter"><code>nc::random::seed(666)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randn(3, 4)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#aeffa74d48c1fb2603f83eaa358f17501">nc::random::randN</a>&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3, 4)</a>)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#aeffa74d48c1fb2603f83eaa358f17501">nc::random::randN</a>&lt;double&gt;({3, 4})</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.randint(0, 10, [3, 4])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3, 4)</a>, 0, 10)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a43201ec4ec8e0c99041647ab45ac0133">nc::random::randInt</a>&lt;int&gt;({3, 4}, 0, 10)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.rand(3, 4)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a0f5694167e15a8bc566a3fa6f842c3b4">nc::random::rand</a>&lt;double&gt;(<a class="el" href="classnc_1_1_shape.html" title="A Shape Class for NdArrays.">nc::Shape(3,4)</a>)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1random.html#a0f5694167e15a8bc566a3fa6f842c3b4">nc::random::rand</a>&lt;double&gt;({3, 4})</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.random.choice(a, 3)</code>   </td><td class="markdownTableBodyCenter"><code>nc::random::choice(a, 3)</code>   </td></tr>
</table>
<h3>CONCATENATION</h3>
<p >Many ways to concatenate <code>NdArray</code> are available.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.stack([a, b, c], axis=0)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#abbb3b38779a9d5cc3f473eef1f914057">nc::stack</a>({a, b, c}, <a class="el" href="namespacenc.html#a5edb9ac6f596ae1256faa3f5d797dc84a54c1ed33c810f895d48c008d89f880b7">nc::Axis::ROW</a>)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.vstack([a, b, c])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#afa75736fe6a9935a89cec98790084779">nc::vstack</a>({a, b, c})</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.hstack([a, b, c])</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#aa5a0927210f0193fd7bbe40dc889b562">nc::hstack</a>({a, b, c})</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.append(a, b, axis=1)</code>   </td><td class="markdownTableBodyCenter"><code>nc::append(a, b, nc::Axis::COL)</code>   </td></tr>
</table>
<h3>DIAGONAL, TRIANGULAR, AND FLIP</h3>
<p >The following return new <code>NdArray</code>s.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diagonal(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::diagonal(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.triu(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::triu(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tril(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::tril(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.flip(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::flip(a, nc::Axis::ROW)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.flipud(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::flipud(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fliplr(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::fliplr(a)</code>   </td></tr>
</table>
<h3>ITERATION</h3>
<p ><b>NumCpp</b> follows the idioms of the C++ STL providing iterator pairs to iterate on arrays in different fashions.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>for value in a</code>   </td><td class="markdownTableBodyCenter"><code>for(auto it = a.begin(); it &lt; a.end(); ++it)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>for(auto&amp; value : a)</code>   </td></tr>
</table>
<h3>LOGICAL</h3>
<p >Logical FUNCTIONS in <b>NumCpp</b> behave the same as <b>NumPy</b>.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.where(a &gt; 5, a, b)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a7a526300e6258fc6a008cfabc53d679c">nc::where</a>(a &gt; 5, a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.any(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::any(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.all(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::all(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.logical_and(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::logical_and(a, b)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.logical_or(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::logical_or(a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isclose(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::isclose(a, b)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.allclose(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::allclose(a, b)</code>   </td></tr>
</table>
<h3>COMPARISONS</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.equal(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::equal(a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a == b</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.not_equal(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::not_equal(a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>a != b</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>rows, cols = np.nonzero(a)</code>   </td><td class="markdownTableBodyCenter"><code>auto [rows, cols] = nc::nonzero(a)</code>   </td></tr>
</table>
<h3>MINIMUM, MAXIMUM, SORTING</h3>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.min(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::min(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.max(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::max(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.argmin(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::argmin(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argmax(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::argmax(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sort(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sort(a, nc::Axis::ROW)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.argsort(a, axis=1)</code>   </td><td class="markdownTableBodyCenter"><code>nc::argsort(a, nc::Axis::COL)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.unique(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::unique(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.setdiff1d(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::setdiff1d(a, b)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.diff(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::diff(a)</code>   </td></tr>
</table>
<h3>REDUCERS</h3>
<p >Reducers accumulate values of <code>NdArray</code>s along specified axes. When no axis is specified, values are accumulated along all axes.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sum(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sum(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sum(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sum(a, nc::Axis::ROW)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.prod(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::prod(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.prod(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::prod(a, nc::Axis::ROW)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.mean(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::mean(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.mean(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::mean(a, nc::Axis::ROW)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.count_nonzero(a, axis=0)</code>   </td><td class="markdownTableBodyCenter"><code>nc::count_nonzero(a, nc::Axis::ROW)</code>   </td></tr>
</table>
<h3>I/O</h3>
<p >Print and file output methods. All <b>NumCpp</b> classes support a <code><a class="el" href="namespacenc.html#aad1fad7ba0ba94b118bdceb29178488b">print()</a></code> method and <code>&lt;&lt;</code> stream operators.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>print(a)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#aad1fad7ba0ba94b118bdceb29178488b">a.print()</a></code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"></td><td class="markdownTableBodyCenter"><code>std::cout &lt;&lt; a</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>a.tofile(filename, sep=’\n’)</code>   </td><td class="markdownTableBodyCenter"><code>a.tofile(filename, '\n')</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.fromfile(filename, sep=’\n’)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#a4c12ae3a4ece2aec1375c34e1729f512">nc::fromfile</a>&lt;dtype&gt;(filename, '\n')</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.dump(a, filename)</code>   </td><td class="markdownTableBodyCenter"><code>nc::dump(a, filename)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.load(filename)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc.html#ad6129b92b4e017a4ca772a59b43960e8">nc::load</a>&lt;dtype&gt;(filename)</code>   </td></tr>
</table>
<h3>MATHEMATICAL FUNCTIONS</h3>
<p ><b>NumCpp</b> universal functions are provided for a large set number of mathematical functions.</p>
<h4>BASIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.abs(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::abs(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sign(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sign(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.remainder(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::remainder(a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.clip(a, 3, 8)</code>   </td><td class="markdownTableBodyCenter"><code>nc::clip(a, 3, 8)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.interp(x, xp, fp)</code>   </td><td class="markdownTableBodyCenter"><code>nc::interp(x, xp, fp)</code>   </td></tr>
</table>
<h4>EXPONENTIAL FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.exp(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::exp(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.expm1(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::expm1(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.log(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::log(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.log1p(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::log1p(a)</code>   </td></tr>
</table>
<h4>POWER FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.power(a, 4)</code>   </td><td class="markdownTableBodyCenter"><code>nc::power(a, 4)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.sqrt(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sqrt(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.square(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::square(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cbrt(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::cbrt(a)</code>   </td></tr>
</table>
<h4>TRIGONOMETRIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sin(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sin(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cos(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::cos(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tan(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::tan(a)</code>   </td></tr>
</table>
<h4>HYPERBOLIC FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.sinh(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::sinh(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.cosh(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::cosh(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.tanh(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::tanh(a)</code>   </td></tr>
</table>
<h4>CLASSIFICATION FUNCTIONS</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.isnan(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::isnan(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.isinf(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::isinf(a)</code>   </td></tr>
</table>
<h4>LINEAR ALGEBRA</h4>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter"><b>NumPy</b>   </th><th class="markdownTableHeadCenter"><b>NumCpp</b>    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.norm(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::norm(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.dot(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::dot(a, b)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.det(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::linalg::det(a)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.inv(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::linalg::inv(a)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>np.linalg.lstsq(a, b)</code>   </td><td class="markdownTableBodyCenter"><code>nc::linalg::lstsq(a, b)</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.matrix_power(a, 3)</code>   </td><td class="markdownTableBodyCenter"><code>nc::linalg::matrix_power(a, 3)</code>    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter"><code>Np.linalg.multi_dot(a, b, c)</code>   </td><td class="markdownTableBodyCenter"><code><a class="el" href="namespacenc_1_1linalg.html#a46188c640b2c3ee74418db676e8f3bce">nc::linalg::multi_dot</a>({a, b, c})</code>    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter"><code>np.linalg.svd(a)</code>   </td><td class="markdownTableBodyCenter"><code>nc::linalg::svd(a)</code>   </td></tr>
</table>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
